<?php
/*
	本插件：$this->model('model')->方法名();
	其他地方调用：model('jy_merchscrm/model')->方法名();
*/
namespace jy_merchscrm;
defined('BY_JYA') or exit('error');
class model extends \plugin{
	public function check_custom(){
		if($_SESSION['container']!='wxwork'){
			exi('请在企业微信端环境下打开！','error');
		}
		return true;
	}
	public function check_worker($openid='',$exi=false){
		$res=model('jy_scrm/model')->check_worker($openid,$exi);
		return $res;
	}
	public function add_apilog($action){
		$res=model('jy_scrm/model')->add_apilog($action);
		return $res;
	}
	public function check_apilog($action,$exi=false){
		$res=model('jy_scrm/model')->check_apilog($action,$exi);
		return $res;
	}
	public function get_csvitems($rows){
		$res=model('jy_scrm/model')->get_csvitems($rows);
		return $res;
	}
	public function jie_state($state,$ExternalUserID='',$UserID=''){
		$res=model('jy_scrm/model')->jie_state($state,$ExternalUserID,$UserID);
		return $res;
	}
	public function giftmsg($state,$ExternalUserID='',$UserID=''){
		$res=model('jy_scrm/model')->giftmsg($state,$ExternalUserID,$UserID);
		return $res;
	}
	public function upqun_welcome($id,$data=array()){
		$res=model('jy_scrm/model')->upqun_welcome($id,$data);
		return $res;
	}
	public function add_external_contact($postdata,$noexi=false){
		$res=model('jy_scrm/model')->add_external_contact($postdata,$noexi);
		return $res;
	}
	public function edit_external_contact($postdata,$noexi=false){
		$res=model('jy_scrm/model')->edit_external_contact($postdata,$noexi);
		return $res;
	}
	public function add_half_external_contact($postdata,$noexi=false){
		$res=model('jy_scrm/model')->add_half_external_contact($postdata,$noexi);
		return $res;
	}
	public function del_external_contact($postdata,$noexi=false){
		$res=model('jy_scrm/model')->del_external_contact($postdata,$noexi);
		return $res;
	}
	public function del_follow_user($postdata,$noexi=false){
		$res=model('jy_scrm/model')->del_follow_user($postdata,$noexi);
		return $res;
	}
	public function chat_add($postdata,$noexi=false){
		$res=model('jy_scrm/model')->chat_add($postdata,$noexi);
		return $res;
	}
	public function chat_dismiss($postdata,$noexi=false){
		$res=model('jy_scrm/model')->chat_dismiss($postdata,$noexi);
		return $res;
	}
	public function tag_add($postdata,$noexi=false){
		$res=model('jy_scrm/model')->tag_add($postdata,$noexi);
		return $res;
	}
	public function tag_update($postdata,$noexi=false){
		$res=model('jy_scrm/model')->tag_update($postdata,$noexi);
		return $res;
	}
	public function tag_delete($postdata,$noexi=false){
		$res=model('jy_scrm/model')->tag_delete($postdata,$noexi);
		return $res;
	}
}
?>